import { removeChildren } from '@/util/util';
export const GetSubCompanyDataView = (that)=>{
  that.$api.publicApi.GetSubCompanyDataView().then(res => { // 公司部门树
    let resData = res.data.data;
    for (let index = 0; index < resData.length; index++) {
      const item = resData[index];
      if (item.childrens && item.childrens.length != 0) {
        removeChildren(item.childrens);
      } else {
        item.childrens = null;
      }
    }
    that.$store.dispatch('setCompanySection', resData);
  });
};